let addBtn = document.querySelector('button') as HTMLButtonElement

let myClick = () => {
  console.log("按钮事件生效了")
}

addBtn.addEventListener('click', myClick)

let removeBtn = document.querySelectorAll('button')[1] as HTMLButtonElement

removeBtn.addEventListener('click', () => {

  addBtn.removeEventListener('click', myClick)
})